function add(x: number, y: number, z?: number): number {
  if (typeof z !== "undefined") {
    return x + y + z;
  }
  return x + y;
}
const sum = add(1, 2);

const sum1 = (x: number, y: number): number => {
  return x + y;
};

let sum2: (x: number, y: number) => number;

sum2 = sum1;

interface ISum {
  (x: number, y: number, z?: number): number;
}

let sum3: ISum;
sum3 = sum1;
